
import http from '@/utils/http';
import {login as apiLogin} from '@/apis/index';

const SEND_SMS = 'login/sendsms'
const REGISTER = 'login/register'
const LOGIN = 'login/login'

const login = {
    state:{

    },
    mutations:{
        [SEND_SMS](state,data){
            state.mobileCode = data;
        }
    },
    actions:{
        async [SEND_SMS]({commit},data){//获取手机验证码
           return  await http.post(apiLogin.sendsms,{data})
        },
        async [REGISTER]({commit},data){//注册
            return  await http.post(apiLogin.register,{data})
        },
        async [LOGIN]({commit},data){//注册
            return  await http.post(apiLogin.login,{data})
        },
        
    },
    getters:{

    }
}


export default login